package com.suemi.missile.common.message;

public abstract class BaseMessage {

  private final MessageType type;

  protected BaseMessage(MessageType type) {
    this.type = type;
  }

  public MessageType getType() {
    return type;
  }


  public static abstract class Request extends BaseMessage {

    public Request(MessageType type) {
      super(type);
    }
  }

  public static abstract class Response extends BaseMessage {

    protected boolean success;
    protected int errCode;
    protected String desc;

    public Response(MessageType type) {
      super(type);
    }

    public boolean isSuccess() {
      return success;
    }

    public void setSuccess(boolean success) {
      this.success = success;
    }

    public int getErrCode() {
      return errCode;
    }

    public void setErrCode(int errCode) {
      this.errCode = errCode;
    }

    public String getDesc() {
      return desc;
    }

    public void setDesc(String desc) {
      this.desc = desc;
    }
  }
}
